Skip to content

Low-level gdal code to write fgdb metadata#2194

Open
jackrosacker wants to merge 30 commits intomainfrom
jcr-fgdb-metadata
Open

Low-level gdal code to write fgdb metadata#2194
jackrosacker wants to merge 30 commits intomainfrom
jcr-fgdb-metadata

Conversation

@jackrosacker
Copy link
Copy Markdown
Contributor

@jackrosacker jackrosacker commented Jan 29, 2026

relates to #2017

todos

  • Decide on approach (i.e. ogr2ogr vs gdal vector edit
  • Write low-level code writing example metadata to an fgdb
  • Ensure test coverage

This PR will focus on low-level code written in dcpgis/utils

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 29, 2026

Codecov Report

❌ Patch coverage is 90.78947% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.81%. Comparing base (07569a1) to head (e1c4bc1).

Files with missing lines Patch % Lines
dcpy/utils/geospatial/fgdb.py 92.30% 2 Missing and 2 partials ⚠️
dcpy/utils/geospatial/shapefile.py 75.00% 1 Missing and 1 partial ⚠️
dcpy/utils/geospatial/esri_metadata.py 93.75% 0 Missing and 1 partial ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
dcpy/utils/geospatial/esri_metadata.py 93.75% <93.75%> (ø)
dcpy/utils/geospatial/shapefile.py 96.10% <75.00%> (-1.65%) ⬇️
dcpy/utils/geospatial/fgdb.py 92.30% <92.30%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jackrosacker jackrosacker added the GIS Related to the GIS team label Jan 29, 2026
@jackrosacker
Copy link
Copy Markdown
Contributor Author

Hey @alexrichey + @damonmcc,

This is very nearly ready for review, but I'm running into some test failures because (I believe) I'm using features from gdal 3.12, while this repo is pinned to a lower version:

=========================== short test summary info ============================
FAILED dcpy/test/utils/geospatial/test_fgdb.py::test_get_layers[run_tests_on_zipped_gdb] - AttributeError: module 'osgeo.gdal' has no attribute 'alg'
FAILED dcpy/test/utils/geospatial/test_fgdb.py::test_get_layers[run_tests_on_nonzipped_gdb] - AttributeError: module 'osgeo.gdal' has no attribute 'alg'
FAILED dcpy/test/utils/geospatial/test_fgdb.py::test_read_metadata[run_tests_on_zipped_gdb] - AttributeError: module 'osgeo.gdal' has no attribute 'alg'
FAILED dcpy/test/utils/geospatial/test_fgdb.py::test_read_metadata[run_tests_on_nonzipped_gdb] - AttributeError: module 'osgeo.gdal' has no attribute 'alg'
FAILED dcpy/test/utils/geospatial/test_fgdb.py::test_write_metadata[run_tests_on_zipped_gdb] - AttributeError: module 'osgeo.gdal' has no attribute 'alg'
FAILED dcpy/test/utils/geospatial/test_fgdb.py::test_write_metadata[run_tests_on_nonzipped_gdb] - AttributeError: module 'osgeo.gdal' has no attribute 'alg'
FAILED dcpy/test/utils/geospatial/test_fgdb.py::test_metadata_exists[run_tests_on_zipped_gdb] - AttributeError: module 'osgeo.gdal' has no attribute 'alg'
FAILED dcpy/test/utils/geospatial/test_fgdb.py::test_metadata_exists[run_tests_on_nonzipped_gdb] - AttributeError: module 'osgeo.gdal' has no attribute 'alg'
FAILED dcpy/test/utils/geospatial/test_fgdb.py::test_remove_metadata[run_tests_on_zipped_gdb] - AttributeError: module 'osgeo.gdal' has no attribute 'alg'
FAILED dcpy/test/utils/geospatial/test_fgdb.py::test_remove_metadata[run_tests_on_nonzipped_gdb] - AttributeError: module 'osgeo.gdal' has no attribute 'alg'
===== 10 failed, 547 passed, 7 xfailed, 8848 warnings in 101.01s (0:01:41) =====
Error: Process completed with exit code 1.

Finn told me to work with the version of gdal that had the features I wanted, and that we'd figure it out later, which is now I guess.

I think our options may be:

  1. I downgrade the gdal calls to use commands that work with the version of gdal that is pinned within data-engineering currently, or
  2. We work to upgrade dcpy to use gdal 3.12. I'm happy to work on this, but would need a point in the right direction
  3. Something else?

@jackrosacker jackrosacker marked this pull request as ready for review March 20, 2026 13:00
@jackrosacker
Copy link
Copy Markdown
Contributor Author

jackrosacker commented Mar 20, 2026

@NYCPlanning/data-engineering this has been ready for review for a while, but I realized I still had it marked as Draft. See notes about gdal versioning above.

@alexrichey
Copy link
Copy Markdown
Contributor

2. We work to upgrade dcpy to use gdal 3.12. I'm happy to work on this, but would need a point in the right direc

hey @jackrosacker apologies, had missed this. I think that upgrading gdal is probably the way to go. It might break a few things, but we can resolve that. Let's try that in a different PR. I'm happy to work on that with you whenever you'd like.

If you'd like to take a shot at it yourself, I'd start a new branch (and PR) and just do a search in the repo for gdal and/or "3.11.3" and try updating those to see what happens. You might see things fail immediately in CI/CD, but more likely we'd have to run a few things with a custom docker image to test. Do you want to start a new PR, upgrade the versions, then sync up to see what (if anything) might break?

@jackrosacker
Copy link
Copy Markdown
Contributor Author

@alexrichey - no worries! Yeah I'm happy to try and fix this. I presume I would leave this PR as-is, work on the gdal upgrade PR, and then return here once the gdal PR has been merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GIS Related to the GIS team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants